
<script src="__PUBLIC__/js/comm.js" type="text/javascript"></script>
<script>

    
    function autologin(){
        $.ajax({
            type: "POST",
            url: "__APP__/Home/Index/doLogin",
            dataType: "json",
            data: "auto",
            success: function(data){
                //alert("Data Loaded: " + data);
                if(data != 0){
                    $('#loginform').html('尊敬的'+data.user_name+'欢迎回来!');
                        $('#loginform1').html('<a href="javascript:;" onclick="logout();"><span>退出</span></a>');
                }
                   
            }
        });
    }

    $(function(){
        bindRegedit('__PUBLIC__/htm/regedit.htm','__APP__/Home/Index/regedit');
        autologin();
        $('#loginBtn').click(function(){
            
            var username = $.trim($('#username').val());
            var password = $.trim($('#password').val());
            var verify = $.trim($('#verify').val());
            if(username.length<1){alert("请填写用户名");return false;}
            if(password.length<1){alert("请填写密码");return false;}
            if(password.verify<1){alert("请填写验证码");return false;}
            $.ajax({
                type: "POST",
                url: "__APP__/Home/Index/doLogin",
                dataType: "json",
                data:   "username="+username+"&password="+password,
                success: function(data){
                    //alert("Data Loaded: " + data);
                    if(data == 0){
                        alert('登陆失败，请重试！');
                    }else if(data == 2){
                    	alert('登陆失败，你的邮箱还未被激活，请激活后再试！');
                    }
                    else{
                    	$('#loginform').html('尊敬的'+data.user_name+'欢迎回来!');
                        $('#loginform1').html('<a href="javascript:;" onclick="logout();"><span>退出</span></a>');
                    }
                }
            });
        });
    });
    function logout(){
        $.get("__APP__/Home/Index/logOut", {},function(){window.location.reload();})
    	$("#login_p").show();
		$("#lio").hide();
	}
</script>
<div id="regeditDiv" style="position:absolute;top:0px;margin:auto;z-index:299"></div>
<div id="header"> 
    <!--上半部分-->
    <div class="header_top">
        <div class="top_menu">
            <ul>
                <li id="loginform">用户名：<input id="username" type="text" size="15" style="height: 12px; width: 80px;"  >&nbsp;
                    密码：<input id="password" size="15" type="password" style="height: 12px; width: 80px;" />
                </li>
                <li class="cart" id="loginform1"><a href="javascript:;" id="loginBtn" ><span>登录</span></a></li>
                <li class="point"><a href="javascript:;" id="regeditBtn"><span>注册</span></a></li>
                <!--<li id="date" class="date">2009年10月6</li>日-->
                <!--<li id="week" class="week">星期</li>二-->
                <!--<li id="time" class="time">8：31</li>-->
                <!--<li id="time_pic" class="time_pic"></li>-->
                <!--农历-->
                <!--<li id="chinese_date" class="chinese_date">四月初六</li>-->
                <!--<span class="solar_terms">小满</span>-->
                <li class="ropmenu_r"></li>
            </ul>
        </div>
        <div class="logo"><a href="#"><img src="__PUBLIC__/images/logo.gif" /></a></div>
        <div class="clear"></div>
    </div>
    <!--end 上半部分--> 
    <!--导航及下半部分-->
    <div class="header_main">
        <div class="menu"> 
            <!--导航-->
            <ul class="menu_list1">
                <li class="menu_list1_r">
                    <ul>
                        <ul>
                            <li class="menu_select"><a href="/">首页</a></li>
                            <li><a href="/Industry/index/id/1">个人用品</a></li>
                            <li><a href="/Industry/index/id/2">办公器材</a></li>
                            <li><a href="/Industry/index/id/3">家居生活</a></li>
                            <li><a href="/Industry/index/id/4">家电数码</a></li>
                            <li><a href="/Industry/index/id/5">汽车天地</a></li>
                            <li><a href="/BaseBrand/">品牌印象</a></li>
                            <li><a href="/User/my/">个人页面</a></li>
                        </ul>
                    </ul>
                </li>
            </ul>
            <!--end 导航--> 
            <!--热门搜索-->
            <!--<if condition="$memo neq ''">
	            <ul class="menu_list2">            
	                {$memo}
	            </ul>
            </if>--> 
            
            <!--end 热门搜索--> 
            <!--search-->
            <div class="search" style="width:450px; margin:0px 0px 0px 50px; padding:8px; background:none; color:#fff;">
            <span>{$industry_explain}</span>
            </div>
            <div class="search">
                <div class="search_th">
                    <form action="__APP__/Share/shareList/" name="form1" method="post">
                        <input type="text" name="query" value="{$query}" class="text" onclick="this.value='';"/>
                        <button class="" type="submit" onclick="document.form1.submit();">搜 索</button>
                    </form>
                </div>
            </div>
            <!--end search--> 
            <!--快捷按钮-->
            <!-- ul class="menu_list3">
					<li>游客您好，获得更好用户体验请注册或登录！</li>
					<li class="cart"><a href="#"><span>登录</span></a></li>
					<li class="point"><a href="#"><span>注册</span></a></li>
				</ul -->
            <!--end 快捷按钮-->
            <div class="clear"></div>
        </div>
        <div class="header_bottom"><div class="menu"></div></div>
    </div>
    <!--end 导航及下半部分--> 
</div>
